package com.wzdigit.wms.wms.service.core;

import com.wzdigit.wms.basic.mapper.core.basic.manager.WarehouseLocationManagerMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class WarehouseLocationService {

    @Autowired
    private WarehouseLocationManagerMapper mapper;

    /**
     * 获取库位可用容量
     *
     * @param locId
     * @return
     */
    public Integer getLocationUsableCapacity(Integer locId) {
        Integer capacity = this.mapper.getLocationUsableCapacity(locId);
        if (capacity == null)
            capacity = 0;
        if (capacity < 0)
            capacity = 0;
        return capacity;
    }
}
